﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="_torneo.ascx.cs" Inherits="BoxScore.torneo._torneo" %>


<asp:GridView ID="GridView1" runat="server" AllowPaging="True" GridLines="None" Width="100%"
    AutoGenerateColumns="False" DataSourceID="ObjectDataSource1">
    <Columns>
        <asp:BoundField DataField="id" HeaderText="id" SortExpression="id" 
            Visible="False" />
        <asp:TemplateField HeaderText="" SortExpression="logo">
            <EditItemTemplate>
                <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("logo") %>'></asp:TextBox>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:Image ID="Image1" runat="server" Width="50px"
                    AlternateText='<%# "logo del torneo " + Eval("name", "{0}") %>' 
                    ImageUrl='<%# "/torneo/images/" + Eval("logo", "{0}") %>' />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Nombre" SortExpression="name">
            <EditItemTemplate>
                <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("name") %>'></asp:TextBox>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:HyperLink ID="HyperLink1" runat="server" 
                    NavigateUrl='<%#  "../torneo/detalle.aspx?id=" + Request["id"] + "&torneo=" + Eval("id", "{0}") %>' Text='<%# Eval("name", "{0}") %>'></asp:HyperLink>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="description" HeaderText="" 
            SortExpression="description" />
        <asp:TemplateField HeaderText="Fecha Inicio" SortExpression="start_date">
            <EditItemTemplate>
                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("start_date") %>'></asp:TextBox>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:Label ID="Label1" runat="server" Text='<%# Bind("start_date", "{0:d}") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Fecha de Culminacion" SortExpression="end_date" Visible="false">
            <EditItemTemplate>
                <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("end_date") %>'></asp:TextBox>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:Label ID="Label2" runat="server" Text='<%# Bind("end_date", "{0:d}") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="award" HeaderText="Premio" SortExpression="award"  Visible="false"/>
        <asp:BoundField DataField="picture" HeaderText="picture" 
            SortExpression="picture" Visible="False" />
    </Columns>
    <EmptyDataTemplate>
        <asp:Label ID="Label1" runat="server" Text="No hay Torneos en esta Liga"></asp:Label>
    </EmptyDataTemplate>
</asp:GridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
    SelectMethod="getTournamentsByLeagues" TypeName="BoxScore.Model.BoxScoreBD">
    <SelectParameters>
        <%--<asp:QueryStringParameter DefaultValue="0" Name="id" QueryStringField="id" Type="Int32" />--%>
        <asp:QueryStringParameter QueryStringField="id" DefaultValue="0" Name="idLeague" Type="Int32" />
    </SelectParameters>
</asp:ObjectDataSource>

